<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/12/13
  Time: 6:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="${pageContext.request.contextPath}/statics/js/jquery-1.12.4.js"></script>
    <script type="text/javascript">
        function a1(){
            $.ajax({
                url:"${pageContext.request.contextPath}/a1",
                data:{"name":$("#name").val()},
                success:function (data){
                    if (data.toString()=="OK"){
                        $("#userInfo").css("color","green")
                    }else {
                        $("#userInfo").css("color","red")
                    }
                    $("#userInfo").html(data)
                }
            })
        }
    </script>
</head>
<body>
<p>
    用户名:<input type="text" id="name" onblur="a1()"/>
    <span id="userInfo"></span>
</p>

<p>
    密码:<input type="text" id="pwd" onblur="a2()"/>
    <span id="pwdInfo"></span>
</p>
</body>
</html>
